Skip to content
  • 0 Votes
    4 Posts
    2k Views
    A

    @silau It looks good but ldd doesn't always report exactly what is actually happening when you run your exe. It's a good start though. If you really wanted to trace it further you would have to ldd on each of those libs to see what they link. One of them could be using the 5.6 or whatever other version you may have. That being said I find that to be a bit unlikely though.

    When I get a little bit of time later today I will run your code using Arch linux and 5.11 and see what happens. That will help determine if maybe it's a bug in Qt (which I highly doubt for something that big).

    If it works for me the next steps for you would be to run it in the debugger and step through the working 5.6 one during socket connections and then the broken 5.11 one and see what is different.

    Another option is take it down to the simplest form and just use the chat example or something from Qt and see if it works with 5.11 and then try to see what is different.

    I'll let you know what I find out on my linux/Qt 5.11 in a bit.

    Edit: Didn't get a chance today, was really busy. I will run a quick test tomorrow some time though.

  • 0 Votes
    8 Posts
    2k Views
    mrjjM

    Hi
    You are mixing old syntax with lambda which it cannot do.
    With lambdas you cannot use the SIGNAL() macro.
    Has to be the new syntax.

    I used

    QObject::connect(&but_submit, &QPushButton::clicked, [&]() {...

    which compiled fine and did show the entered string.

    But you seems to be using
    Qt-4.8.5 at and new syntax first came in Qt5
    so i guess that is why you get errors.

    So basically, with that old Qt , you cannot do it in main.
    You need a QOBJECT based object to send signals to.
    In that old Qt, its not possible to connect to functions.
    Only to member slots in a class.

    You must use that so old Qt ?

  • failed connect

    Solved General and Desktop
    12
    0 Votes
    12 Posts
    5k Views
    N

    Thank you all for helping detect ths error. I will take a close look at the related docs.
    Regards, Nico

  • 0 Votes
    1 Posts
    4k Views
    No one has replied
  • 0 Votes
    3 Posts
    3k Views
    A

    @diredko Qt will output signal/slot problems on the console. Run your application from the console and you should see something like:

    QObject::connect: No such slot QObject::movePiece(int, int, int, int)

    Or something similar if there is an issue.

    Also you can add a qDebug() << "Got here" to your connect() but like @SGaist said, you are connecting in a bad place. qDebugs() will show up on the console as well.

    If you are in windows you will have to add CONFIG += console to your project file. Linux and OSX should be fine without.

    And finally add qDebug() messages to your move and movePiece to see if it's getting in there.

    Or of course you could use the debugger for all this. ;)

  • 0 Votes
    6 Posts
    3k Views
    L

    @TheBadger
    I tried to investigate the error, and i found where it is coming from
    its from this line
    playList.emplace_back(ui->song->text().toStdString());
    which is written before the connect() in the code

  • 0 Votes
    24 Posts
    10k Views
    K

    @SGaist
    Yes. That was intensional. I just tested that my installation is still providing the message.
    Thanks a lot anyway.